ETF_ServerInit = {
	//初始化数据库框架
	["ETF", "SQL_CUSTOM", "ETF.ini"] call MySQL_fnc_ExtDBinit;
	
	//添加断开事件
	addMissionEventHandler ["HandleDisconnect",{

		params ["_unit", "_id", "_uid", "_name"];

		
		_playerLoadout = getUnitLoadout _unit;
		[_playerLoadout, _uid] remoteExecCall ["ETF_saveStats", 2];
		


		// diag_log format["xxxxxxxxx:0000000 %1", str(_playerLoadout)];

		// [_playerLoadout, _uid] remoteExecCall ["ETF_saveStats", 2];


		// _player = _unit;
		
		// _items = [(uniformItems _player), (vestItems _player), (backpackItems _player), (assignedItems _player)];
		// _clothes = [(uniform _player), (vest _player), (backpack _player), (headgear _player)];
		// _weapons = [];
		// if (primaryWeapon _player != "") then {
		// 	_weapons pushBack [0, primaryWeapon _player, primaryWeaponMagazine _player, primaryWeaponItems _player, _player ammo (primaryWeapon _player)];
		// };
		// if (secondaryWeapon _player != "") then {
		// 	_weapons pushBack [1, secondaryWeapon _player, secondaryWeaponMagazine _player, secondaryWeaponItems _player, _player ammo (secondaryWeapon _player)];
		// };
		// if (handgunWeapon _player != "") then {
		// 	_weapons pushBack [2, handgunWeapon _player, handgunMagazine _player, handgunItems _player, _player ammo (handgunWeapon _player)];
		// };
		//[_items,_clothes,_weapons, _uid] remoteExecCall ["ETF_saveStats", 2];

	}];

};